import request from '@/utils/request'
import store from '@/store'
// 查询用户整体数据
export function eventAnalysis(params = {}) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/event_analysis`,
    method: 'get',
    params
  })
}
// 查询用户饼图数据
export function getEventDistribution(params = {}) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_event_distribution`,
    method: 'get',
    params
  })
}
// 菜单接口
export function menuList(params = {}) {
  return request({
    url: `/${store.state.user.business}/admin/get_menu_list/`,
    method: 'get',
    params
  })
}
// 预制数据
export function getPreset(params = {}) {
  return request({
    url: `/${store.state.user.business}/admin/permission/get_user_menu_list/`,
    method: 'get',
    params
  })
}

export function getList(params) {
  return request({
    url: '/table/list',
    method: 'get',
    params
  })
}
// 用户数据统计， 玩法统计
export function getAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_bet_user_analysis/`,
    method: 'get',
    params
  })
}

// 玩法统计 analysis/get_user_chn/
export function getUserChn(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_user_chn/`,
    method: 'get',
    params
  })
}

// 活跃用户 analysis/get_user_chn/
export function getActiveUser(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_active_user_analysis/`,
    method: 'get',
    params
  })
}
// 活跃用户盈亏分析
export function getrechargeStage(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_recharge_stage_analysis/`,
    method: 'get',
    params
  })
}

// 支付数据统计
export function getrechargeAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/recharge_analysis/`,
    method: 'get',
    params
  })
}

// 产品数据分析，水果机
export function gameReport(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/game_report`,
    method: 'get',
    params
  })
}

// 商户编辑
export function business(data) {
  return request({
    url: `/${store.state.user.business}/admin/business`,
    method: 'post',
    data
  })
}

// 商户删除
export function deleteBusiness(businessId) {
  return request({
    url: `/${store.state.user.business}/admin/business/${businessId}`,
    method: 'delete',
    data: {}
  })
}

// 創建账号
export function createUser(data) {
  return request({
    url: '/admin/user/register',
    method: 'post',
    data
  })
}

// 付费能力分析
export function PayAbility(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_pay_ability_analysis`,
    method: 'get',
    params
  })
}
// 玩法分段分析
export function PlayAbility(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_game_stage_analysis/`,
    method: 'get',
    params
  })
}
// 每日利润分析
export function WithdrawStageAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_withdraw_stage_analysis`,
    method: 'get',
    params
  })
}

// 每日利润分析
export function getProfitAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_profit_analysis`,
    method: 'get',
    params
  })
}

// 每日整体分析
export function getAggregateAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_aggregate_analysis/`,
    method: 'get',
    params
  })
}

// 整体数据分析
export function getGeneralAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_general_analysis/`,
    method: 'get',
    params
  })
}

// 渠道数据分析
export function getChannelAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_channel_analysis/`,
    method: 'get',
    params
  })
}

// 每日电玩城统计
export function getGameAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_game_aggregate_analysis/`,
    method: 'get',
    params
  })
}

// 基础数据明细
export function eventDetail(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/event_detail/`,
    method: 'get',
    params
  })
}

// 系统奖励统计
export function getPlatformRewardEventDetail(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_platform_reward_event_detail/`,
    method: 'get',
    params
  })
}

// 每日充值分析
export function getRechargeAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_recharge_analysis/`,
    method: 'get',
    params
  })
}
// 每日提现分析
export function getWithdraweAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_withdraw_analysis/`,
    method: 'get',
    params
  })
}

// 新用户留存分析
export function getNewUserStayAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_new_user_stay_analysis/`,
    method: 'get',
    params
  })
}

// 提现明细
export function getWithdrawDetail(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_withdraw_event_detail/`,
    method: 'get',
    params
  })
}
// 充值明细
export function getRechargeDetail(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_recharge_event_detail/`,
    method: 'get',
    params
  })
}

// 每日报表分析
export function getDailyAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_daily_analysis/`,
    method: 'get',
    params
  })
}

// 新用户分析
export function getNewUser(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_new_user_analysis/`,
    method: 'get',
    params
  })
}

export function getOnPay(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_continuous_recharge_analysis/`,
    method: 'get',
    params
  })
}

// 每日用户分析
export function getOpUserAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_op_user_analysis/`,
    method: 'get',
    params
  })
}

// 线上报表，渠道分析
export function channelAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/channel_analysis/`,
    method: 'get',
    params
  })
}
// 线上报表，玩法分析
export function rechargeAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/recharge_analysis/`,
    method: 'get',
    params
  })
}
// 线上报表，玩法分析
export function withdrawAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/withdraw_analysis/`,
    method: 'get',
    params
  })
}

// 线上报表，产品营收
export function productProfitAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/product_profit_analysis/`,
    method: 'get',
    params
  })
}

// 线上报表，用户分析
export function UserAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/user_analysis/`,
    method: 'get',
    params
  })
}
export function RuleAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/integrated/bet_analysis/`,
    method: 'get',
    params
  })
}

// 每日玩法统计 游戏类型/玩法 字段
export function getDwcGameType(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_game_aggregate_analysis/preset/`,
    method: 'get',
    params
  })
}

export function getPayChn(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_pay_type/`,
    method: 'get',
    params
  })
}

// 捕鱼抽水分析
export function getFishPumpAnalysis(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_fish_profit_analysis/`,
    method: 'get',
    params
  })
}

// 捕鱼抽水分析下拉框
export function getFishPumpPreset(params) {
  return request({
    url: `/${store.state.user.business}/admin/analysis/get_fish_profit_analysis/preset/`,
    method: 'get',
    params
  })
}
